import React, { Component } from 'react'

export default class NavBar2 extends Component {
  render() {
    console.log(this.props, 'this.props----');
    const defaultProps = {
      leftSlot: <span>aaa1</span>,
      centerSlot: <strong>bbb</strong>,
      rightSlot: <a href='/#'>ccc</a>
    }
    // let leftSlot, centerSlot, rightSlot
    if (!Object.keys(this.props).length) {
      var { leftSlot, centerSlot, rightSlot } = defaultProps
      // leftSlot = defaultProps.leftSlot
      // centerSlot = defaultProps.centerSlot
      // rightSlot = defaultProps.rightSlot
    } else {
      var { leftSlot, centerSlot, rightSlot } = this.props
      // leftSlot = this.props.leftSlot
      // centerSlot = this.props.centerSlot
      // rightSlot = this.props.rightSlot
    }
    return (
      <div className="nav-item nav-bar">
        <div className="nav-left">
          {leftSlot}
        </div>
        <div className="nav-item nav-center">
          {centerSlot}
        </div>
        <div className="nav-item nav-right">
          {rightSlot}
        </div>
      </div>
    )
  }
}
